#include <bits/stdc++.h>

using namespace std;
const int N = 30;
int n, m;
int st[N];
int path[N];

void dfs(int pre, int num)
{

    if (num > m)
    {
        for (int i = 1; i <= n; ++i)
        {
            if (st[i] == 1)
            {
                cout << i << " ";
            }
        }
        cout << endl;
        return;
    }

    for (int i = 1; i <= n; ++i)
    {
        if (i > pre && st[i] == 0)
        {
        }
    }
}
int main()
{
    cin >> n >> m;
    dfs(0, 1);
    return 0;
}